package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.LiveAdvisoryMapper;
import com.jieshuibao.model.db.LiveAdvisory;
import com.jieshuibao.model.db.LiveAdvisoryExample;

@Service
public class LiveAdvisoryService{
	
	@Resource
	private LiveAdvisoryMapper liveAdvisoryMapper;
	
	public void addLiveAdvisory(LiveAdvisory liveAdvisory) {
		liveAdvisoryMapper.insertSelective(liveAdvisory);
	}
	
	public void delLiveAdvisoryByUuid(String uuid) {
		liveAdvisoryMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateLiveAdvisory(LiveAdvisory liveAdvisory) {
		liveAdvisoryMapper.updateByPrimaryKeySelective(liveAdvisory);
	}
	
	public LiveAdvisory getLiveAdvisoryByUuid(String uuid) {
		return liveAdvisoryMapper.selectByPrimaryKey(uuid);
	}
	
	public List<LiveAdvisory> getPageLiveAdvisory(LiveAdvisoryExample liveAdvisoryExample) {
		return liveAdvisoryMapper.selectPage(liveAdvisoryExample);
	}
	
	public int countLiveAdvisory(LiveAdvisoryExample liveAdvisoryExample) {
		return liveAdvisoryMapper.countByExample(liveAdvisoryExample);
	}
}
